<template>
  <div class="app">
		<ul>
			<li v-for="(item,index) in list" :key="index" :class="{active:count==index}" @click="fn(index)">
				{{item.title}}
			</li>
		</ul>

	</div>
</template>

<script>
export default {
  data (){
	  return {
		  list:[
			  {
				  title:"语文",
				  content:"这是语文"
			  },
			  {
			  	  title:"数学",
			  	  content:"这是数学"
			  },
			  {
			  	   title:"英语",
			  	   content:"这是英语"
			  },
		  ],
		  count:0
	  }
	  
  },
  methods:{
	  fn(index){
          this.count = index;
          this.$bus.$emit('mock',this.count)
	  }
  }
}
</script>

<style scoped>
	ul{
	width: 100%;
	height: 50px;
	list-style: none;
	display: flex;
	justify-content: space-around;
}
 .cont{
	 width: 100%;
	 height: 50px;
 }
</style>